clear all
n = 50;
load W_stage0_eh0_comp1.out
w_f_g=W_stage0_eh0_comp1; % Read wages, g and f distributions

wf_1=transpose(linspace(w_f_g(30),w_f_g(34), 50));        % Wage in formal sector
wi_1=transpose(linspace(w_f_g(29),w_f_g(33), 50));         % Wage in informal sector
wf_2=transpose(linspace(w_f_g(32),w_f_g(36), 50));      % Wage in formal sector
wi_2=transpose(linspace(w_f_g(31),w_f_g(35), 50));      % Wage in informal sector
Par1 = zeros(23,1);
load ParEst_eh0_stage0 ParEst_eh0_stage0


load ParEst_eh0_stage0_boot1 ParEst_eh0_stage0_boot1
 Par1(1:22) = ParEst_eh0_stage0_boot1;
Par1(21) = 10^Par1(21);
Par1(22)=1000*Par1(22);
Par1(23) = 0;
[Ff_1,ff_1,Fi_1,fi_1,Ff_2,ff_2,Fi_2,fi_2]=solve_wage_offer_dist(Par1,wf_1,wi_1,wf_2,wi_2,n);
[Wff,Wfi,Wfn,Wif,Wnf,Wii,Win,Wni,Wnn,b1,b2]=solve_value_function_A3_S(Par1...
    ,Ff_1,wf_1,Fi_1,wi_1,Ff_2,wf_2,Fi_2,wi_2,n);
[HHstates,wage_moments,transitions]=data_simulation_A12_end(Par1,ff_1,wf_1,fi_1,...
    wi_1,ff_2,wf_2,fi_2,wi_2,Wff,Wfi,Wfn,Wif,Wnf,Wii,Win,Wni,Wnn);

HH_avg_Inc = wage_moments(17) + b2;
MWP_a_boot1 = Par1(22)/exp(-theta*HH_avg_Inc);
save MWP_a_boot1 MWP_a_boot1


load ParEst_eh0_stage0_boot3 ParEst_eh0_stage0_boot3
 Par1(1:22) = ParEst_eh0_stage0_boot3;
Par1(21) = 10^Par1(21);
Par1(22)=1000*Par1(22);
Par1(23) = 0;
[Ff_1,ff_1,Fi_1,fi_1,Ff_2,ff_2,Fi_2,fi_2]=solve_wage_offer_dist(Par1,wf_1,wi_1,wf_2,wi_2,n);
[Wff,Wfi,Wfn,Wif,Wnf,Wii,Win,Wni,Wnn,b1,b2]=solve_value_function_A3_S(Par1...
    ,Ff_1,wf_1,Fi_1,wi_1,Ff_2,wf_2,Fi_2,wi_2,n);
[HHstates,wage_moments,transitions]=data_simulation_A12_end(Par1,ff_1,wf_1,fi_1,...
    wi_1,ff_2,wf_2,fi_2,wi_2,Wff,Wfi,Wfn,Wif,Wnf,Wii,Win,Wni,Wnn);

HH_avg_Inc = wage_moments(17) + b2;
MWP_a_boot3 = Par1(22)/exp(-theta*HH_avg_Inc);
save MWP_a_boot3 MWP_a_boot3


load ParEst_eh0_stage0_boot5 ParEst_eh0_stage0_boot5
 Par1(1:22) = ParEst_eh0_stage0_boot5;
Par1(21) = 10^Par1(21);
Par1(22)=1000*Par1(22);
Par1(23) = 0;
[Ff_1,ff_1,Fi_1,fi_1,Ff_2,ff_2,Fi_2,fi_2]=solve_wage_offer_dist(Par1,wf_1,wi_1,wf_2,wi_2,n);
[Wff,Wfi,Wfn,Wif,Wnf,Wii,Win,Wni,Wnn,b1,b2]=solve_value_function_A3_S(Par1...
    ,Ff_1,wf_1,Fi_1,wi_1,Ff_2,wf_2,Fi_2,wi_2,n);
[HHstates,wage_moments,transitions]=data_simulation_A12_end(Par1,ff_1,wf_1,fi_1,...
    wi_1,ff_2,wf_2,fi_2,wi_2,Wff,Wfi,Wfn,Wif,Wnf,Wii,Win,Wni,Wnn);

HH_avg_Inc = wage_moments(17) + b2;
MWP_a_boot5 = Par1(22)/exp(-theta*HH_avg_Inc);
save MWP_a_boot5 MWP_a_boot5

load ParEst_eh0_stage0_boot6 ParEst_eh0_stage0_boot6
 Par1(1:22) = ParEst_eh0_stage0_boot6;
Par1(21) = 10^Par1(21);
Par1(22)=1000*Par1(22);
Par1(23) = 0;
[Ff_1,ff_1,Fi_1,fi_1,Ff_2,ff_2,Fi_2,fi_2]=solve_wage_offer_dist(Par1,wf_1,wi_1,wf_2,wi_2,n);
[Wff,Wfi,Wfn,Wif,Wnf,Wii,Win,Wni,Wnn,b1,b2]=solve_value_function_A3_S(Par1...
    ,Ff_1,wf_1,Fi_1,wi_1,Ff_2,wf_2,Fi_2,wi_2,n);
[HHstates,wage_moments,transitions]=data_simulation_A12_end(Par1,ff_1,wf_1,fi_1,...
    wi_1,ff_2,wf_2,fi_2,wi_2,Wff,Wfi,Wfn,Wif,Wnf,Wii,Win,Wni,Wnn);

HH_avg_Inc = wage_moments(17) + b2;
MWP_a_boot6 = Par1(22)/exp(-theta*HH_avg_Inc);
save MWP_a_boot6 MWP_a_boot6

load ParEst_eh0_stage0_boot7 ParEst_eh0_stage0_boot7
 Par1(1:22) = ParEst_eh0_stage0_boot7;
Par1(21) = 10^Par1(21);
Par1(22)=1000*Par1(22);
Par1(23) = 0;
[Ff_1,ff_1,Fi_1,fi_1,Ff_2,ff_2,Fi_2,fi_2]=solve_wage_offer_dist(Par1,wf_1,wi_1,wf_2,wi_2,n);
[Wff,Wfi,Wfn,Wif,Wnf,Wii,Win,Wni,Wnn,b1,b2]=solve_value_function_A3_S(Par1...
    ,Ff_1,wf_1,Fi_1,wi_1,Ff_2,wf_2,Fi_2,wi_2,n);
[HHstates,wage_moments,transitions]=data_simulation_A12_end(Par1,ff_1,wf_1,fi_1,...
    wi_1,ff_2,wf_2,fi_2,wi_2,Wff,Wfi,Wfn,Wif,Wnf,Wii,Win,Wni,Wnn);

HH_avg_Inc = wage_moments(17) + b2;
MWP_a_boot7 = Par1(22)/exp(-theta*HH_avg_Inc);
save MWP_a_boot7 MWP_a_boot7

load ParEst_eh0_stage0_boot8 ParEst_eh0_stage0_boot8
 Par1(1:22) = ParEst_eh0_stage0_boot8;
Par1(21) = 10^Par1(21);
Par1(22)=1000*Par1(22);
Par1(23) = 0;
[Ff_1,ff_1,Fi_1,fi_1,Ff_2,ff_2,Fi_2,fi_2]=solve_wage_offer_dist(Par1,wf_1,wi_1,wf_2,wi_2,n);
[Wff,Wfi,Wfn,Wif,Wnf,Wii,Win,Wni,Wnn,b1,b2]=solve_value_function_A3_S(Par1...
    ,Ff_1,wf_1,Fi_1,wi_1,Ff_2,wf_2,Fi_2,wi_2,n);
[HHstates,wage_moments,transitions]=data_simulation_A12_end(Par1,ff_1,wf_1,fi_1,...
    wi_1,ff_2,wf_2,fi_2,wi_2,Wff,Wfi,Wfn,Wif,Wnf,Wii,Win,Wni,Wnn);

HH_avg_Inc = wage_moments(17) + b2;
MWP_a_boot8 = Par1(22)/exp(-theta*HH_avg_Inc);
save MWP_a_boot8 MWP_a_boot8


load ParEst_eh0_stage0_boot11 ParEst_eh0_stage0_boot11
 Par1(1:22) = ParEst_eh0_stage0_boot11;
Par1(21) = 10^Par1(21);
Par1(22)=1000*Par1(22);
Par1(23) = 0;
[Ff_1,ff_1,Fi_1,fi_1,Ff_2,ff_2,Fi_2,fi_2]=solve_wage_offer_dist(Par1,wf_1,wi_1,wf_2,wi_2,n);
[Wff,Wfi,Wfn,Wif,Wnf,Wii,Win,Wni,Wnn,b1,b2]=solve_value_function_A3_S(Par1...
    ,Ff_1,wf_1,Fi_1,wi_1,Ff_2,wf_2,Fi_2,wi_2,n);
[HHstates,wage_moments,transitions]=data_simulation_A12_end(Par1,ff_1,wf_1,fi_1,...
    wi_1,ff_2,wf_2,fi_2,wi_2,Wff,Wfi,Wfn,Wif,Wnf,Wii,Win,Wni,Wnn);

HH_avg_Inc = wage_moments(17) + b2;
MWP_a_boot11 = Par1(22)/exp(-theta*HH_avg_Inc);
save MWP_a_boot11 MWP_a_boot11

load ParEst_eh0_stage0_boot12 ParEst_eh0_stage0_boot12
 Par1(1:22) = ParEst_eh0_stage0_boot12;
Par1(21) = 10^Par1(21);
Par1(22)=1000*Par1(22);
Par1(23) = 0;
[Ff_1,ff_1,Fi_1,fi_1,Ff_2,ff_2,Fi_2,fi_2]=solve_wage_offer_dist(Par1,wf_1,wi_1,wf_2,wi_2,n);
[Wff,Wfi,Wfn,Wif,Wnf,Wii,Win,Wni,Wnn,b1,b2]=solve_value_function_A3_S(Par1...
    ,Ff_1,wf_1,Fi_1,wi_1,Ff_2,wf_2,Fi_2,wi_2,n);
[HHstates,wage_moments,transitions]=data_simulation_A12_end(Par1,ff_1,wf_1,fi_1,...
    wi_1,ff_2,wf_2,fi_2,wi_2,Wff,Wfi,Wfn,Wif,Wnf,Wii,Win,Wni,Wnn);

HH_avg_Inc = wage_moments(17) + b2;
MWP_a_boot12 = Par1(22)/exp(-theta*HH_avg_Inc);
save MWP_a_boot12 MWP_a_boot12

load ParEst_eh0_stage0_boot13 ParEst_eh0_stage0_boot13
 Par1(1:22) = ParEst_eh0_stage0_boot13;
Par1(21) = 10^Par1(21);
Par1(22)=1000*Par1(22);
Par1(23) = 0;
[Ff_1,ff_1,Fi_1,fi_1,Ff_2,ff_2,Fi_2,fi_2]=solve_wage_offer_dist(Par1,wf_1,wi_1,wf_2,wi_2,n);
[Wff,Wfi,Wfn,Wif,Wnf,Wii,Win,Wni,Wnn,b1,b2]=solve_value_function_A3_S(Par1...
    ,Ff_1,wf_1,Fi_1,wi_1,Ff_2,wf_2,Fi_2,wi_2,n);
[HHstates,wage_moments,transitions]=data_simulation_A12_end(Par1,ff_1,wf_1,fi_1,...
    wi_1,ff_2,wf_2,fi_2,wi_2,Wff,Wfi,Wfn,Wif,Wnf,Wii,Win,Wni,Wnn);

HH_avg_Inc = wage_moments(17) + b2;
MWP_a_boot13 = Par1(22)/exp(-theta*HH_avg_Inc);
save MWP_a_boot13 MWP_a_boot13

load ParEst_eh0_stage0_boot15 ParEst_eh0_stage0_boot15
 Par1(1:22) = ParEst_eh0_stage0_boot15;
Par1(21) = 10^Par1(21);
Par1(22)=1000*Par1(22);
Par1(23) = 0;
[Ff_1,ff_1,Fi_1,fi_1,Ff_2,ff_2,Fi_2,fi_2]=solve_wage_offer_dist(Par1,wf_1,wi_1,wf_2,wi_2,n);
[Wff,Wfi,Wfn,Wif,Wnf,Wii,Win,Wni,Wnn,b1,b2]=solve_value_function_A3_S(Par1...
    ,Ff_1,wf_1,Fi_1,wi_1,Ff_2,wf_2,Fi_2,wi_2,n);
[HHstates,wage_moments,transitions]=data_simulation_A12_end(Par1,ff_1,wf_1,fi_1,...
    wi_1,ff_2,wf_2,fi_2,wi_2,Wff,Wfi,Wfn,Wif,Wnf,Wii,Win,Wni,Wnn);

HH_avg_Inc = wage_moments(17) + b2;
MWP_a_boot15 = Par1(22)/exp(-theta*HH_avg_Inc);
save MWP_a_boot15 MWP_a_boot15

load ParEst_eh0_stage0_boot16 ParEst_eh0_stage0_boot16
 Par1(1:22) = ParEst_eh0_stage0_boot16;
Par1(21) = 10^Par1(21);
Par1(22)=1000*Par1(22);
Par1(23) = 0;
[Ff_1,ff_1,Fi_1,fi_1,Ff_2,ff_2,Fi_2,fi_2]=solve_wage_offer_dist(Par1,wf_1,wi_1,wf_2,wi_2,n);
[Wff,Wfi,Wfn,Wif,Wnf,Wii,Win,Wni,Wnn,b1,b2]=solve_value_function_A3_S(Par1...
    ,Ff_1,wf_1,Fi_1,wi_1,Ff_2,wf_2,Fi_2,wi_2,n);
[HHstates,wage_moments,transitions]=data_simulation_A12_end(Par1,ff_1,wf_1,fi_1,...
    wi_1,ff_2,wf_2,fi_2,wi_2,Wff,Wfi,Wfn,Wif,Wnf,Wii,Win,Wni,Wnn);

HH_avg_Inc = wage_moments(17) + b2;
MWP_a_boot16 = Par1(22)/exp(-theta*HH_avg_Inc);
save MWP_a_boot16 MWP_a_boot16

load ParEst_eh0_stage0_boot17 ParEst_eh0_stage0_boot17
 Par1(1:22) = ParEst_eh0_stage0_boot17;
Par1(21) = 10^Par1(21);
Par1(22)=1000*Par1(22);
Par1(23) = 0;
[Ff_1,ff_1,Fi_1,fi_1,Ff_2,ff_2,Fi_2,fi_2]=solve_wage_offer_dist(Par1,wf_1,wi_1,wf_2,wi_2,n);
[Wff,Wfi,Wfn,Wif,Wnf,Wii,Win,Wni,Wnn,b1,b2]=solve_value_function_A3_S(Par1...
    ,Ff_1,wf_1,Fi_1,wi_1,Ff_2,wf_2,Fi_2,wi_2,n);
[HHstates,wage_moments,transitions]=data_simulation_A12_end(Par1,ff_1,wf_1,fi_1,...
    wi_1,ff_2,wf_2,fi_2,wi_2,Wff,Wfi,Wfn,Wif,Wnf,Wii,Win,Wni,Wnn);

HH_avg_Inc = wage_moments(17) + b2;
MWP_a_boot17 = Par1(22)/exp(-theta*HH_avg_Inc);
save MWP_a_boot17 MWP_a_boot17

load ParEst_eh0_stage0_boot18 ParEst_eh0_stage0_boot18
 Par1(1:22) = ParEst_eh0_stage0_boot18;
Par1(21) = 10^Par1(21);
Par1(22)=1000*Par1(22);
Par1(23) = 0;
[Ff_1,ff_1,Fi_1,fi_1,Ff_2,ff_2,Fi_2,fi_2]=solve_wage_offer_dist(Par1,wf_1,wi_1,wf_2,wi_2,n);
[Wff,Wfi,Wfn,Wif,Wnf,Wii,Win,Wni,Wnn,b1,b2]=solve_value_function_A3_S(Par1...
    ,Ff_1,wf_1,Fi_1,wi_1,Ff_2,wf_2,Fi_2,wi_2,n);
[HHstates,wage_moments,transitions]=data_simulation_A12_end(Par1,ff_1,wf_1,fi_1,...
    wi_1,ff_2,wf_2,fi_2,wi_2,Wff,Wfi,Wfn,Wif,Wnf,Wii,Win,Wni,Wnn);

HH_avg_Inc = wage_moments(17) + b2;
MWP_a_boot18 = Par1(22)/exp(-theta*HH_avg_Inc);
save MWP_a_boot18 MWP_a_boot18

load ParEst_eh0_stage0_boot19 ParEst_eh0_stage0_boot19
 Par1(1:22) = ParEst_eh0_stage0_boot19;
Par1(21) = 10^Par1(21);
Par1(22)=1000*Par1(22);
Par1(23) = 0;
[Ff_1,ff_1,Fi_1,fi_1,Ff_2,ff_2,Fi_2,fi_2]=solve_wage_offer_dist(Par1,wf_1,wi_1,wf_2,wi_2,n);
[Wff,Wfi,Wfn,Wif,Wnf,Wii,Win,Wni,Wnn,b1,b2]=solve_value_function_A3_S(Par1...
    ,Ff_1,wf_1,Fi_1,wi_1,Ff_2,wf_2,Fi_2,wi_2,n);
[HHstates,wage_moments,transitions]=data_simulation_A12_end(Par1,ff_1,wf_1,fi_1,...
    wi_1,ff_2,wf_2,fi_2,wi_2,Wff,Wfi,Wfn,Wif,Wnf,Wii,Win,Wni,Wnn);

HH_avg_Inc = wage_moments(17) + b2;
MWP_a_boot1 = Par1(22)/exp(-theta*HH_avg_Inc);
save MWP_a_boot19 MWP_a_boot19

load ParEst_eh0_stage0_boot21 ParEst_eh0_stage0_boot21
 Par1(1:22) = ParEst_eh0_stage0_boot21;
Par1(21) = 10^Par1(21);
Par1(22)=1000*Par1(22);
Par1(23) = 0;
[Ff_1,ff_1,Fi_1,fi_1,Ff_2,ff_2,Fi_2,fi_2]=solve_wage_offer_dist(Par1,wf_1,wi_1,wf_2,wi_2,n);
[Wff,Wfi,Wfn,Wif,Wnf,Wii,Win,Wni,Wnn,b1,b2]=solve_value_function_A3_S(Par1...
    ,Ff_1,wf_1,Fi_1,wi_1,Ff_2,wf_2,Fi_2,wi_2,n);
[HHstates,wage_moments,transitions]=data_simulation_A12_end(Par1,ff_1,wf_1,fi_1,...
    wi_1,ff_2,wf_2,fi_2,wi_2,Wff,Wfi,Wfn,Wif,Wnf,Wii,Win,Wni,Wnn);

HH_avg_Inc = wage_moments(17) + b2;
MWP_a_boot21 = Par1(22)/exp(-theta*HH_avg_Inc);
save MWP_a_boot21 MWP_a_boot21

load ParEst_eh0_stage0_boot23 ParEst_eh0_stage0_boot23
 Par1(1:22) = ParEst_eh0_stage0_boot23;
Par1(21) = 10^Par1(21);
Par1(22)=1000*Par1(22);
Par1(23) = 0;
[Ff_1,ff_1,Fi_1,fi_1,Ff_2,ff_2,Fi_2,fi_2]=solve_wage_offer_dist(Par1,wf_1,wi_1,wf_2,wi_2,n);
[Wff,Wfi,Wfn,Wif,Wnf,Wii,Win,Wni,Wnn,b1,b2]=solve_value_function_A3_S(Par1...
    ,Ff_1,wf_1,Fi_1,wi_1,Ff_2,wf_2,Fi_2,wi_2,n);
[HHstates,wage_moments,transitions]=data_simulation_A12_end(Par1,ff_1,wf_1,fi_1,...
    wi_1,ff_2,wf_2,fi_2,wi_2,Wff,Wfi,Wfn,Wif,Wnf,Wii,Win,Wni,Wnn);

HH_avg_Inc = wage_moments(17) + b2;
MWP_a_boot23 = Par1(22)/exp(-theta*HH_avg_Inc);
save MWP_a_boot23 MWP_a_boot23

load ParEst_eh0_stage0_boot24 ParEst_eh0_stage0_boot24
 Par1(1:22) = ParEst_eh0_stage0_boot24;
Par1(21) = 10^Par1(21);
Par1(22)=1000*Par1(22);
Par1(23) = 0;
[Ff_1,ff_1,Fi_1,fi_1,Ff_2,ff_2,Fi_2,fi_2]=solve_wage_offer_dist(Par1,wf_1,wi_1,wf_2,wi_2,n);
[Wff,Wfi,Wfn,Wif,Wnf,Wii,Win,Wni,Wnn,b1,b2]=solve_value_function_A3_S(Par1...
    ,Ff_1,wf_1,Fi_1,wi_1,Ff_2,wf_2,Fi_2,wi_2,n);
[HHstates,wage_moments,transitions]=data_simulation_A12_end(Par1,ff_1,wf_1,fi_1,...
    wi_1,ff_2,wf_2,fi_2,wi_2,Wff,Wfi,Wfn,Wif,Wnf,Wii,Win,Wni,Wnn);

HH_avg_Inc = wage_moments(17) + b2;
MWP_a_boot24 = Par1(22)/exp(-theta*HH_avg_Inc);
save MWP_a_boot24 MWP_a_boot24

load ParEst_eh0_stage0_boot26 ParEst_eh0_stage0_boot26
 Par1(1:22) = ParEst_eh0_stage0_boot26;
Par1(21) = 10^Par1(21);
Par1(22)=1000*Par1(22);
Par1(23) = 0;
[Ff_1,ff_1,Fi_1,fi_1,Ff_2,ff_2,Fi_2,fi_2]=solve_wage_offer_dist(Par1,wf_1,wi_1,wf_2,wi_2,n);
[Wff,Wfi,Wfn,Wif,Wnf,Wii,Win,Wni,Wnn,b1,b2]=solve_value_function_A3_S(Par1...
    ,Ff_1,wf_1,Fi_1,wi_1,Ff_2,wf_2,Fi_2,wi_2,n);
[HHstates,wage_moments,transitions]=data_simulation_A12_end(Par1,ff_1,wf_1,fi_1,...
    wi_1,ff_2,wf_2,fi_2,wi_2,Wff,Wfi,Wfn,Wif,Wnf,Wii,Win,Wni,Wnn);

HH_avg_Inc = wage_moments(17) + b2;
MWP_a_boot26 = Par1(22)/exp(-theta*HH_avg_Inc);
save MWP_a_boot26 MWP_a_boot26

load ParEst_eh0_stage0_boot27 ParEst_eh0_stage0_boot27
 Par1(1:22) = ParEst_eh0_stage0_boot27;
Par1(21) = 10^Par1(21);
Par1(22)=1000*Par1(22);
Par1(23) = 0;
[Ff_1,ff_1,Fi_1,fi_1,Ff_2,ff_2,Fi_2,fi_2]=solve_wage_offer_dist(Par1,wf_1,wi_1,wf_2,wi_2,n);
[Wff,Wfi,Wfn,Wif,Wnf,Wii,Win,Wni,Wnn,b1,b2]=solve_value_function_A3_S(Par1...
    ,Ff_1,wf_1,Fi_1,wi_1,Ff_2,wf_2,Fi_2,wi_2,n);
[HHstates,wage_moments,transitions]=data_simulation_A12(Par1,ff_1,wf_1,fi_1,...
    wi_1,ff_2,wf_2,fi_2,wi_2,Wff,Wfi,Wfn,Wif,Wnf,Wii,Win,Wni,Wnn);
[HHstates,wage_moments,transitions]=data_simulation_A12_end(Par1,ff_1,wf_1,fi_1,...
    wi_1,ff_2,wf_2,fi_2,wi_2,Wff,Wfi,Wfn,Wif,Wnf,Wii,Win,Wni,Wnn);

HH_avg_Inc = wage_moments(17) + b2;
MWP_a_boot27 = Par1(22)/exp(-theta*HH_avg_Inc);
save MWP_a_boot27 MWP_a_boot27

load ParEst_eh0_stage0_boot28 ParEst_eh0_stage0_boot28
 Par1(1:22) = ParEst_eh0_stage0_boot28;
Par1(21) = 10^Par1(21);
Par1(22)=1000*Par1(22);
Par1(23) = 0;
[Ff_1,ff_1,Fi_1,fi_1,Ff_2,ff_2,Fi_2,fi_2]=solve_wage_offer_dist(Par1,wf_1,wi_1,wf_2,wi_2,n);
[Wff,Wfi,Wfn,Wif,Wnf,Wii,Win,Wni,Wnn,b1,b2]=solve_value_function_A3_S(Par1...
    ,Ff_1,wf_1,Fi_1,wi_1,Ff_2,wf_2,Fi_2,wi_2,n);
[HHstates,wage_moments,transitions]=data_simulation_A12_end(Par1,ff_1,wf_1,fi_1,...
    wi_1,ff_2,wf_2,fi_2,wi_2,Wff,Wfi,Wfn,Wif,Wnf,Wii,Win,Wni,Wnn);

HH_avg_Inc = wage_moments(17) + b2;
MWP_a_boot28 = Par1(22)/exp(-theta*HH_avg_Inc);
save MWP_a_boot28 MWP_a_boot28

load ParEst_eh0_stage0_boot30 ParEst_eh0_stage0_boot30
 Par1(1:22) = ParEst_eh0_stage0_boot30;
Par1(21) = 10^Par1(21);
Par1(22)=1000*Par1(22);
Par1(23) = 0;
[Ff_1,ff_1,Fi_1,fi_1,Ff_2,ff_2,Fi_2,fi_2]=solve_wage_offer_dist(Par1,wf_1,wi_1,wf_2,wi_2,n);
[Wff,Wfi,Wfn,Wif,Wnf,Wii,Win,Wni,Wnn,b1,b2]=solve_value_function_A3_S(Par1...
    ,Ff_1,wf_1,Fi_1,wi_1,Ff_2,wf_2,Fi_2,wi_2,n);
[HHstates,wage_moments,transitions]=data_simulation_A12_end(Par1,ff_1,wf_1,fi_1,...
    wi_1,ff_2,wf_2,fi_2,wi_2,Wff,Wfi,Wfn,Wif,Wnf,Wii,Win,Wni,Wnn);

HH_avg_Inc = wage_moments(17) + b2;
MWP_a_boot30 = Par1(22)/exp(-theta*HH_avg_Inc);
save MWP_a_boot30 MWP_a_boot30

load ParEst_eh0_stage0_boot31 ParEst_eh0_stage0_boot31
 Par1(1:22) = ParEst_eh0_stage0_boot31;
Par1(21) = 10^Par1(21);
Par1(22)=1000*Par1(22);
Par1(23) = 0;
[Ff_1,ff_1,Fi_1,fi_1,Ff_2,ff_2,Fi_2,fi_2]=solve_wage_offer_dist(Par1,wf_1,wi_1,wf_2,wi_2,n);
[Wff,Wfi,Wfn,Wif,Wnf,Wii,Win,Wni,Wnn,b1,b2]=solve_value_function_A3_S(Par1...
    ,Ff_1,wf_1,Fi_1,wi_1,Ff_2,wf_2,Fi_2,wi_2,n);
[HHstates,wage_moments,transitions]=data_simulation_A12_end(Par1,ff_1,wf_1,fi_1,...
    wi_1,ff_2,wf_2,fi_2,wi_2,Wff,Wfi,Wfn,Wif,Wnf,Wii,Win,Wni,Wnn);

HH_avg_Inc = wage_moments(17) + b2;
MWP_a_boot31 = Par1(22)/exp(-theta*HH_avg_Inc);
save MWP_a_boot31 MWP_a_boot31

load ParEst_eh0_stage0_boot32 ParEst_eh0_stage0_boot32
 Par1(1:22) = ParEst_eh0_stage0_boot32;
Par1(21) = 10^Par1(21);
Par1(22)=1000*Par1(22);
Par1(23) = 0;
[Ff_1,ff_1,Fi_1,fi_1,Ff_2,ff_2,Fi_2,fi_2]=solve_wage_offer_dist(Par1,wf_1,wi_1,wf_2,wi_2,n);
[Wff,Wfi,Wfn,Wif,Wnf,Wii,Win,Wni,Wnn,b1,b2]=solve_value_function_A3_S(Par1...
    ,Ff_1,wf_1,Fi_1,wi_1,Ff_2,wf_2,Fi_2,wi_2,n);
[HHstates,wage_moments,transitions]=data_simulation_A12_end(Par1,ff_1,wf_1,fi_1,...
    wi_1,ff_2,wf_2,fi_2,wi_2,Wff,Wfi,Wfn,Wif,Wnf,Wii,Win,Wni,Wnn);

HH_avg_Inc = wage_moments(17) + b2;
MWP_a_boot32 = Par1(22)/exp(-theta*HH_avg_Inc);
save MWP_a_boot32 MWP_a_boot32

load ParEst_eh0_stage0_boot33 ParEst_eh0_stage0_boot33
 Par1(1:22) = ParEst_eh0_stage0_boot33;
Par1(21) = 10^Par1(21);
Par1(22)=1000*Par1(22);
Par1(23) = 0;
[Ff_1,ff_1,Fi_1,fi_1,Ff_2,ff_2,Fi_2,fi_2]=solve_wage_offer_dist(Par1,wf_1,wi_1,wf_2,wi_2,n);
[Wff,Wfi,Wfn,Wif,Wnf,Wii,Win,Wni,Wnn,b1,b2]=solve_value_function_A3_S(Par1...
    ,Ff_1,wf_1,Fi_1,wi_1,Ff_2,wf_2,Fi_2,wi_2,n);
[HHstates,wage_moments,transitions]=data_simulation_A12_end(Par1,ff_1,wf_1,fi_1,...
    wi_1,ff_2,wf_2,fi_2,wi_2,Wff,Wfi,Wfn,Wif,Wnf,Wii,Win,Wni,Wnn);

HH_avg_Inc = wage_moments(17) + b2;
MWP_a_boot33 = Par1(22)/exp(-theta*HH_avg_Inc);
save MWP_a_boot3 MWP_a_boot33

load ParEst_eh0_stage0_boot34 ParEst_eh0_stage0_boot34
 Par1(1:22) = ParEst_eh0_stage0_boot34;
Par1(21) = 10^Par1(21);
Par1(22)=1000*Par1(22);
Par1(23) = 0;
[Ff_1,ff_1,Fi_1,fi_1,Ff_2,ff_2,Fi_2,fi_2]=solve_wage_offer_dist(Par1,wf_1,wi_1,wf_2,wi_2,n);
[Wff,Wfi,Wfn,Wif,Wnf,Wii,Win,Wni,Wnn,b1,b2]=solve_value_function_A3_S(Par1...
    ,Ff_1,wf_1,Fi_1,wi_1,Ff_2,wf_2,Fi_2,wi_2,n);
[HHstates,wage_moments,transitions]=data_simulation_A12_end(Par1,ff_1,wf_1,fi_1,...
    wi_1,ff_2,wf_2,fi_2,wi_2,Wff,Wfi,Wfn,Wif,Wnf,Wii,Win,Wni,Wnn);

HH_avg_Inc = wage_moments(17) + b2;
MWP_a_boot34 = Par1(22)/exp(-theta*HH_avg_Inc);
save MWP_a_boot34 MWP_a_boot34

load ParEst_eh0_stage0_boot35 ParEst_eh0_stage0_boot35
 Par1(1:22) = ParEst_eh0_stage0_boot35;
Par1(21) = 10^Par1(21);
Par1(22)=1000*Par1(22);
Par1(23) = 0;
[Ff_1,ff_1,Fi_1,fi_1,Ff_2,ff_2,Fi_2,fi_2]=solve_wage_offer_dist(Par1,wf_1,wi_1,wf_2,wi_2,n);
[Wff,Wfi,Wfn,Wif,Wnf,Wii,Win,Wni,Wnn,b1,b2]=solve_value_function_A3_S(Par1...
    ,Ff_1,wf_1,Fi_1,wi_1,Ff_2,wf_2,Fi_2,wi_2,n);
[HHstates,wage_moments,transitions]=data_simulation_A12_end(Par1,ff_1,wf_1,fi_1,...
    wi_1,ff_2,wf_2,fi_2,wi_2,Wff,Wfi,Wfn,Wif,Wnf,Wii,Win,Wni,Wnn);

HH_avg_Inc = wage_moments(17) + b2;
MWP_a_boot35 = Par1(22)/exp(-theta*HH_avg_Inc);
save MWP_a_boot35 MWP_a_boot35

load ParEst_eh0_stage0_boot36 ParEst_eh0_stage0_boot36
 Par1(1:22) = ParEst_eh0_stage0_boot36;
Par1(21) = 10^Par1(21);
Par1(22)=1000*Par1(22);
Par1(23) = 0;
[Ff_1,ff_1,Fi_1,fi_1,Ff_2,ff_2,Fi_2,fi_2]=solve_wage_offer_dist(Par1,wf_1,wi_1,wf_2,wi_2,n);
[Wff,Wfi,Wfn,Wif,Wnf,Wii,Win,Wni,Wnn,b1,b2]=solve_value_function_A3_S(Par1...
    ,Ff_1,wf_1,Fi_1,wi_1,Ff_2,wf_2,Fi_2,wi_2,n);
[HHstates,wage_moments,transitions]=data_simulation_A12_end(Par1,ff_1,wf_1,fi_1,...
    wi_1,ff_2,wf_2,fi_2,wi_2,Wff,Wfi,Wfn,Wif,Wnf,Wii,Win,Wni,Wnn);

HH_avg_Inc = wage_moments(17) + b2;
MWP_a_boot36 = Par1(22)/exp(-theta*HH_avg_Inc);
save MWP_a_boot36 MWP_a_boot36

load ParEst_eh0_stage0_boot40 ParEst_eh0_stage0_boot40
 Par1(1:22) = ParEst_eh0_stage0_boot40;
Par1(21) = 10^Par1(21);
Par1(22)=1000*Par1(22);
Par1(23) = 0;
[Ff_1,ff_1,Fi_1,fi_1,Ff_2,ff_2,Fi_2,fi_2]=solve_wage_offer_dist(Par1,wf_1,wi_1,wf_2,wi_2,n);
[Wff,Wfi,Wfn,Wif,Wnf,Wii,Win,Wni,Wnn,b1,b2]=solve_value_function_A3_S(Par1...
    ,Ff_1,wf_1,Fi_1,wi_1,Ff_2,wf_2,Fi_2,wi_2,n);
[HHstates,wage_moments,transitions]=data_simulation_A12_end(Par1,ff_1,wf_1,fi_1,...
    wi_1,ff_2,wf_2,fi_2,wi_2,Wff,Wfi,Wfn,Wif,Wnf,Wii,Win,Wni,Wnn);

HH_avg_Inc = wage_moments(17) + b2;
MWP_a_boot40 = Par1(22)/exp(-theta*HH_avg_Inc);
save MWP_a_boot40 MWP_a_boot40

load ParEst_eh0_stage0_boot41 ParEst_eh0_stage0_boot41
 Par1(1:22) = ParEst_eh0_stage0_boot41;
Par1(21) = 10^Par1(21);
Par1(22)=1000*Par1(22);
Par1(23) = 0;
[Ff_1,ff_1,Fi_1,fi_1,Ff_2,ff_2,Fi_2,fi_2]=solve_wage_offer_dist(Par1,wf_1,wi_1,wf_2,wi_2,n);
[Wff,Wfi,Wfn,Wif,Wnf,Wii,Win,Wni,Wnn,b1,b2]=solve_value_function_A3_S(Par1...
    ,Ff_1,wf_1,Fi_1,wi_1,Ff_2,wf_2,Fi_2,wi_2,n);
[HHstates,wage_moments,transitions]=data_simulation_A12_end(Par1,ff_1,wf_1,fi_1,...
    wi_1,ff_2,wf_2,fi_2,wi_2,Wff,Wfi,Wfn,Wif,Wnf,Wii,Win,Wni,Wnn);

HH_avg_Inc = wage_moments(17) + b2;
MWP_a_boot41 = Par1(22)/exp(-theta*HH_avg_Inc);
save MWP_a_boot41 MWP_a_boot41

load ParEst_eh0_stage0_boot42 ParEst_eh0_stage0_boot42
 Par1(1:22) = ParEst_eh0_stage0_boot42;
Par1(21) = 10^Par1(21);
Par1(22)=1000*Par1(22);
Par1(23) = 0;
[Ff_1,ff_1,Fi_1,fi_1,Ff_2,ff_2,Fi_2,fi_2]=solve_wage_offer_dist(Par1,wf_1,wi_1,wf_2,wi_2,n);
[Wff,Wfi,Wfn,Wif,Wnf,Wii,Win,Wni,Wnn,b1,b2]=solve_value_function_A3_S(Par1...
    ,Ff_1,wf_1,Fi_1,wi_1,Ff_2,wf_2,Fi_2,wi_2,n);
[HHstates,wage_moments,transitions]=data_simulation_A12_end(Par1,ff_1,wf_1,fi_1,...
    wi_1,ff_2,wf_2,fi_2,wi_2,Wff,Wfi,Wfn,Wif,Wnf,Wii,Win,Wni,Wnn);

HH_avg_Inc = wage_moments(17) + b2;
MWP_a_boot42 = Par1(22)/exp(-theta*HH_avg_Inc);
save MWP_a_boot42 MWP_a_boot42

load ParEst_eh0_stage0_boot44 ParEst_eh0_stage0_boot44
 Par1(1:22) = ParEst_eh0_stage0_boot44;
Par1(21) = 10^Par1(21);
Par1(22)=1000*Par1(22);
Par1(23) = 0;
[Ff_1,ff_1,Fi_1,fi_1,Ff_2,ff_2,Fi_2,fi_2]=solve_wage_offer_dist(Par1,wf_1,wi_1,wf_2,wi_2,n);
[Wff,Wfi,Wfn,Wif,Wnf,Wii,Win,Wni,Wnn,b1,b2]=solve_value_function_A3_S(Par1...
    ,Ff_1,wf_1,Fi_1,wi_1,Ff_2,wf_2,Fi_2,wi_2,n);
[HHstates,wage_moments,transitions]=data_simulation_A12_end(Par1,ff_1,wf_1,fi_1,...
    wi_1,ff_2,wf_2,fi_2,wi_2,Wff,Wfi,Wfn,Wif,Wnf,Wii,Win,Wni,Wnn);

HH_avg_Inc = wage_moments(17) + b2;
MWP_a_boot44 = Par1(22)/exp(-theta*HH_avg_Inc);
save MWP_a_boot44 MWP_a_boot44

load ParEst_eh0_stage0_boot48 ParEst_eh0_stage0_boot48
 Par1(1:22) = ParEst_eh0_stage0_boot48;
Par1(21) = 10^Par1(21);
Par1(22)=1000*Par1(22);
Par1(23) = 0;
[Ff_1,ff_1,Fi_1,fi_1,Ff_2,ff_2,Fi_2,fi_2]=solve_wage_offer_dist(Par1,wf_1,wi_1,wf_2,wi_2,n);
[Wff,Wfi,Wfn,Wif,Wnf,Wii,Win,Wni,Wnn,b1,b2]=solve_value_function_A3_S(Par1...
    ,Ff_1,wf_1,Fi_1,wi_1,Ff_2,wf_2,Fi_2,wi_2,n);
[HHstates,wage_moments,transitions]=data_simulation_A12_end(Par1,ff_1,wf_1,fi_1,...
    wi_1,ff_2,wf_2,fi_2,wi_2,Wff,Wfi,Wfn,Wif,Wnf,Wii,Win,Wni,Wnn);

HH_avg_Inc = wage_moments(17) + b2;
MWP_a_boot48 = Par1(22)/exp(-theta*HH_avg_Inc);
save MWP_a_boot48 MWP_a_boot48

load ParEst_eh0_stage0_boot49 ParEst_eh0_stage0_boot49
 Par1(1:22) = ParEst_eh0_stage0_boot49;
Par1(21) = 10^Par1(21);
Par1(22)=1000*Par1(22);
Par1(23) = 0;
[Ff_1,ff_1,Fi_1,fi_1,Ff_2,ff_2,Fi_2,fi_2]=solve_wage_offer_dist(Par1,wf_1,wi_1,wf_2,wi_2,n);
[Wff,Wfi,Wfn,Wif,Wnf,Wii,Win,Wni,Wnn,b1,b2]=solve_value_function_A3_S(Par1...
    ,Ff_1,wf_1,Fi_1,wi_1,Ff_2,wf_2,Fi_2,wi_2,n);
[HHstates,wage_moments,transitions]=data_simulation_A12_end(Par1,ff_1,wf_1,fi_1,...
    wi_1,ff_2,wf_2,fi_2,wi_2,Wff,Wfi,Wfn,Wif,Wnf,Wii,Win,Wni,Wnn);

HH_avg_Inc = wage_moments(17) + b2;
MWP_a_boot49 = Par1(22)/exp(-theta*HH_avg_Inc);
save MWP_a_boot49 MWP_a_boot49

load ParEst_eh0_stage0_boot50 ParEst_eh0_stage0_boot50
 Par1(1:22) = ParEst_eh0_stage0_boot50;
Par1(21) = 10^Par1(21);
Par1(22)=1000*Par1(22);
Par1(23) = 0;
[Ff_1,ff_1,Fi_1,fi_1,Ff_2,ff_2,Fi_2,fi_2]=solve_wage_offer_dist(Par1,wf_1,wi_1,wf_2,wi_2,n);
[Wff,Wfi,Wfn,Wif,Wnf,Wii,Win,Wni,Wnn,b1,b2]=solve_value_function_A3_S(Par1...
    ,Ff_1,wf_1,Fi_1,wi_1,Ff_2,wf_2,Fi_2,wi_2,n);
[HHstates,wage_moments,transitions]=data_simulation_A12_end(Par1,ff_1,wf_1,fi_1,...
    wi_1,ff_2,wf_2,fi_2,wi_2,Wff,Wfi,Wfn,Wif,Wnf,Wii,Win,Wni,Wnn);

HH_avg_Inc = wage_moments(17) + b2;
MWP_a_boot50 = Par1(22)/exp(-theta*HH_avg_Inc);
save MWP_a_boot50 MWP_a_boot50